package fr.contest.eureka.entity;

/**
 * Class that represents a player, with his game and network attributes.
 * @author Romain, Guillaume
 *
 */
public class Player {
	
	/** Player Name attribute.  */
	private String mPlayerName;
	
	/** Player Score. */
	private int mPlayerScore;
	
	/** Player port used for network communication. */
	private int mPlayerPort;
	
	/** 
	 * Constructor for player object.
	 * @param aName name of the player
	 * @param aPort port used to communicate with the player
	 */
	public Player(String aName, int aPort)
	{
		mPlayerName = aName;
		mPlayerPort = aPort;
		mPlayerScore = 0; // initialize the score to 0
	}
	
	/**
	 * Getter for player name.
	 */
	public String getPlayerName()
	{
		return mPlayerName;
	}
	
	/**
	 * Getter for player score.
	 */
	public int getPlayerScore()
	{
		return mPlayerScore;
	}
	
	/**
	 * Getter for player port.
	 */
	public int getPlayerPort()
	{
		return mPlayerPort;
	}
	
	/**
	 * Increase player score.
	 * @param aPoints points to add to its score
	 * @return new value of player score
	 */
	public int increaseScore(int aPoints)
	{
		// add the points and return the new score
		return mPlayerScore += aPoints;
	}
}
